import 'package:flutter_test/flutter_test.dart';
import 'package:im_app/im/dao/ImCollectDao.dart';
import 'package:im_app/im/pojo/ImPojo.dart';
import 'package:im_app/im/util/DbUtil.dart';
import 'package:im_app/im/util/ImSingleton.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';

void main() {
  test("search collects", () async {
    sqfliteFfiInit();
    databaseFactory = databaseFactoryFfi;
    Database database = await DbUtil.connect("imtest.db");
    ImSingleton.getInstance()?.dataBase = database;

    var collectDao = ImCollectDao();
    List<ImCollect> result = await collectDao.getCollects('曹操', null, null, 500);
    for (var mg in result) {
      print("name: ${mg.serverId}, ${mg.messageId}");
    }
    print("size: " + result.length.toString());
    database.close();
  });
}